package com.ctgu.springstart;

import com.ctgu.springstart.domain.User;
import com.ctgu.springstart.service.UserService;
import junit.framework.TestCase;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = {SpringStartApplication.class})
public class SpringBootTestDemo {

    @Autowired
    UserService userService;

    @Test
    public void testOne(){
        User user = userService.findUserById(3);
        userService.deleteUser(user);
    }

    @Test
    public void testTwo(){
        System.out.println("test hello 2");
        TestCase.assertEquals(1, 1);
    }

    @Before
    public void testBefore(){
        System.out.println("test before");
        TestCase.assertEquals(1, 1);
    }

}
